home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-05-26 | 45.0 KB | 1,228 lines |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- F A S T S O R T 1.60
-
-
- OPERATOR'S HANDBOOK AND PROGRAMMER'S GUIDE
-
-
- Version 1.60 - May 1990
-
-
-
-
-
-
-
-
-
-
- copyright (c) 1989, 1990
-
- DC Software
- 6705 Laramie Dr.
- Plano, Texas 75023
- FastSort - Version 1.60 - General Purpose File Sorting and Handling Utility
-
-
-
- The SHARE-WARE Licence Agreement
- --------------------------------
-
- Copyright (c) 1988, 1989, 1990 by David A. Hernandez, DBA DC Software
-
- You are free to use, copy and distribute this product provided:
-
- - NO FEE IS CHARGED FOR IT. (See Note Below)
-
- - IT IS DISTRIBUTED COMPLETE IN IT'S ORIGINAL FORM WITH ALL THE
- ORIGINAL FILES. SEE BELOW FOR COMPLETE LIST OF FILES.
-
- - IT IS NOT MODIFIED IN ANY WAY.
-
- Distributors of Public Domain and Share Ware Software, Clubs, User Groups
- and others, my charge a fee (Maximum $10) for shiping, handling and other
- expenses.
-
- This program is provided AS IS without any warranty, expressed or
- implied, including, but not limited to, fitness for a particular
- purpose.
-
- If you find this program useful, and continue to use it beyond a short
- trial period (about 1 month), you should send a registration fee of $25
- the address below, in effect buying the product. Upon receipt of the
- registration fee, you will be sent the latest copy of the software, and
- will be entitled to free technical support by phone or mail. If you have
- any problems with the software, it will be addressed promptly.
-
- Suggestions for enhancements and/or bug reports are welcome. The first
- registered user to report a bug will get a free update when it is fixed.
-
- Unlimited use within a single physical building (Site License) is $100.
-
- Corporate Licenses available. Please write.
-
- The FASTSORT.EXE archived program contains the following files:
-
- FSORT.EXE The FASTSORT program.
- FSORT.DOC - The FASTSORT documentation.
- FSORT.LIC - The FASTSORT License Agreement. (This Page)
- FSORT.FRM - The FASTSORT registration form.
- FSORT.LST - List of bugs and enhancements up to this version.
- EZSORT.EXE The FASTSORT easy to use, full screen interface.
- EZSORT.HLP - A simple help file for the EZSORT interface.
- DBINFO.EXE A utility to display DBASE-III file headers.
-
- Enjoy.
-
- DC Software
- 6705 Laramie Dr.
- Plano, TX 75023
- FASTSORT - General Purpose File Sorting and Handling Utility Page 1
-
-
-
-
- Table of Contents
- -----------------
-
-
-
- Topic Page
- ----- ----
-
- Table of Contents .................................. 1
-
- General Information ................................ 2
-
- Notation, Running FASTSORT ......................... 3
-
- Quick Reference Card ............................... 4
-
- Full Command Reference ............................. 5
-
- Files and Records .................................. 8
-
- SuperSort(tm) Compatibility ........................ 9
-
- Fields and Key Types................................ 10
-
- Output File Options ................................ 12
-
- Key Transformations ................................ 15
-
- Examples and Tips .................................. 17
-
- What the future holds .............................. 19
-
- The EZSORT interface ............................... 20
-
- Registration Forms ................................. 21
-
- FASTSORT - General Purpose File Sorting and Handling Utility Page 2
-
-
-
- General Information
- -------------------
-
- * FASTSORT will run on any IBM PC or compatible running PC/MS-DOS 2.0
- or higher with as little as 100K of free RAM.
-
- * FASTSORT will use all available memory to maximize sorting speed and
- never requires (but may use) more than 6 free DOS file handles.
-
- * The main FASTSORT interface is called FSORT and is modeled after the
- Super Sort(tm) program marketed by Micro Pro International in the late
- 1970's and early 1980's. While no longer available (to my knowledge)
- it was at one time the ONE AND ONLY SORT, as many of you may recall.
- Some degree of compatibility with Super Sort has been built into this
- product, but full compatibility was never a goal.
-
- * Trade Marks
-
- - IBM-PC is a registered trademark of International Business Machines.
- - MS-DOS is a registered trademark of Microsoft Inc.
- - dBASE III is a registered trademark of Ashton-Tate.
- - Super Sort is a registered trademark of Micro Pro International
- - FASTSORT is a trademark of DC Software
-
-
- Features and Overview
- ---------------------
-
- * Sort up to 32 input files into a single output file. Files can have
- fixed or variable length records, carriage return delimited records,
- or even be relative (COBOL) files. Special files like .DBF (dBASE)
- can be easily sorted.
-
- * Up to 32 sort fields may be specified. Sort fields ASCENDING or
- DESCENDING, use special collating sequences like EBCDIC, UPPER-CASE,
- LEXICAL, or create your own. Sort normal text, binary fields, BCD,
- fixed point, floating point (single or double precision), LO-HI and
- many more.
-
- * Up to 32 SELECT/EXCLUDE commands using all field types.
-
- * Up to 64 WRITE fields including PADing.
-
- * Specify ranges of records to be included from each input file.
-
- * Convert among file types, cr-delimited to fixed length, DBASE III to
- relative, etc.
-
- * Generate special files containing sorted KEYS, record numbers,
- selected fields or even byte offsets into the original file. Create
- index files that can be binary-searched for quick access into BIG
- data bases.
-
- * Put commands in a text file, to be executed at any time.
-
- * Easy to use EZSORT interface generates command files interactively.
-
- * There's much more to FASTSORT than sorting.
- FASTSORT - General Purpose File Sorting and Handling Utility Page 3
-
-
-
-
- Notation
- --------
-
- UPPER-CASE Upper case KEYWORDs should be typed as shown. You can
- abbreviate keywords by in most cases to the first two
- letters except as noted in the documentation.
-
- lower-case This is information that must be supplied by the user.
- Filenames, record sizes, etc.
-
- [ ] The text enclosed in brackets is optional.
-
- x|y|z Alternatives to choose from. [x|y|z] would indicate
- that you MAY choose one, but you don't have too.
-
- [, ...] The previous parameter may be repeated more than once.
-
- [=|+] Some commands may be issued several times. An "=" sign
- will reset the values and start over again, a "+" sign
- will add the new values to the ones previously entered.
-
- * An asterisk preceding a command in the reference indicates
- that the command is REQUIRED.
-
- & You may use an AMPERSAND at the end of a line to
- indicate that the command continues on the next line.
- You may use up to 255 characters for each command.
-
- constants A constant is a number (sequence of digits) or a string
- (enclosed in single or double quotes). You may add the
- qualifier H after a string to indicate that it is a HEX
- string (i.e. characters 0-9 and A-F only), which is then
- stored internally in binary (two digits to a byte).
-
- Running FASTSORT
- ----------------
-
- FASTSORT can receive instructions as command line arguments, from one
- or more command files and through interactive user input.
-
- To invoke FASTSORT type:
-
- FSORT <Enter> or
- FSORT [CF=commandfile] <Enter> or
- FSORT [command;command;command..] <Enter>
-
- If no GO command is encountered (either in the command file or in the
- arguments), FASTSORT will automatically go into interactive mode.
-
- Or, you can use the new EZSORT interface, and let it create your command
- files for you!
-
- FASTSORT - General Purpose File Sorting and Handling Utility Page 4
-
-
-
- Quick Reference Card
- --------------------
-
- CANCEL
-
- CFILE [=] filespec
-
- COLLATING-SEQUENCE [=|+] new-sequence [, ...]
-
- FOOTER [=] 'left string/center string/right string'
-
- * GO | BYE
-
- HEADER [=] header-size [RETAIN]
-
- * INPUT-ATTRIBUTES [=] max-record-size[,] file-type
-
- - FIXED, RELATIVE, VARIABLE, CR-DELIMITED, DBASEIII
-
- * KEY [=|+] start-col, end-col, [key-order], [key-type] ...
-
- - ASCENDING, DESCENDING
-
- - UPPER-CASE, LEXICAL-ORDER, EBCDIC, ALTSEQ, NUMERIC-ASCII, LO-HI
- PACKED-BCD, FLOATING-POINT, MSBIN-FLOAT, INTEGER, TWOS-COMPLEMENT,
- ZERO-DELIMITED, PASCAL-STRING, COMPUTATIONAL, COMPUTATIONAL-3,
- RIGHT-JUSTIFY, MASK-PARITY-BIT.
-
- LIST-COMMANDS
-
- * OUTPUT-FILE [=] filespec [out-rec-size] [file-type] [out-data-type]
-
- - FIXED, RELATIVE, VARIABLE, CR-DELIMITED, DBASEIII
-
- - K-OUTPUT, L-OUTPUT, O-OUTPUT, R-OUTPUT, R2-OUTPUT, P-OUTPUT,
- KL-OUTPUT, KO-OUTPUT, KR-OUTPUT, KR2-OUTPUT, KP-OUTPUT.
-
- PAGE-SIZE [=] line-count
-
- * READ-FILES [=|+] filespec[(from-record, to-record)] [, filespec...]
-
- RETURN-TO-CONSOLE
-
- PRINT-LEVEL [=] print-level
-
- [SELECT|EXCLUDE] [=|+] expression [AND|OR expression]
-
- * SORT-FILES [=|+] filespec[(from-record, to-record)] [, filespec...]
-
- STABLE [OFF|ON]
-
- TITLE [=|+] 'left string/center string/right string'
-
- UNIQUE [OFF|ON]
-
- WRITE-FILE [=|+] [FIELD start-col, end-col | PAD [length] [char]]
- FASTSORT - General Purpose File Sorting and Handling Utility Page 5
-
-
-
- Full Command Reference
- ----------------------
-
- BYE
- -
- Exit FASTSORT. Don't process pending commands.
-
- CANCEL
- --
- Clear all commands. (Does not clear COLLATING-SEQUENCE).
-
- CFILE [=] filespec
- --
- Read commands from command file.
-
- COLLATING-SEQUENCE [=|+] char [- char] [= pos [+|-]], ...
- --
- Sets character collating sequence. For any character or range of
- characters, you specify an order relative to the other chars.
-
- Example: Sort numerics first in reverse order, then lower case alpha
- in ascending order, then upper case in no specific order (weird, but
- it makes a point. All other chars are sorder normally.
-
- COL = '9'-'0', 'a'-'z', 'A'-'Z'=37
-
- Example: Sort everything in reverse:
-
- COL = 255-0 or COL = 0-255=255-
-
- FOOTER [=] 'left string/center string/right string'
- -
- A single line of text at the end of each page. [WRITE-FILE only]. The
- left, center and right strings will be justified (with a maximum width
- of 255 characters on a line. You may also include %ppp.. to indicate
- a page number (the number of Ps (+1 for the %) gives the size of the
- field), and %m (month 01-12), %mm (month Jan,Feb..), %y (year 01-99),
- and %d (day 01-31).
-
- * GO
- -
- Process currently defined commands. See RETURN-TO-CONSOLE.
-
- HEADER [=] header-size [RETAIN]
- -
- Indicates that the input file has a header with non-record information
- of 'header-size' bytes. The RETAIN option indicates that the header
- should be copied to the output file. Only the header for the first
- input file will be copied into the output file. DBASE headers will
- be handled automatically if the input type is DBASEIII.
-
- * INPUT-ATTRIBUTES [=] max-recsize[,] file-type
- -
- Input files will have records not exceeding 'max-recsize' bytes. The
- maximum size is 64K. Also, indicates the 'file-type' which may be
- FIXED, RELATIVE, VARIABLE, CR-DELIMITED or DBASEIII.
-
- FASTSORT - General Purpose File Sorting and Handling Utility Page 6
-
-
-
- Full Command Reference (continued)
- ----------------------------------
-
- * KEY [=|+] start-col, end-col [ASC|DESC] [key-type [qualif]], ...
-
- Up to 32 keys. The key-type is one of the following:
-
- - no key-type ASCII collating sequence.
- - UPPER-CASE Ignore upper/lower diff.
- - LEXICAL-ORDER AaBbCcDd..
- - EBCDIC EBCDIC collating sequence.
- - ALTSEQ Use user's COLLATING-SEQUENCE
- - NUMERIC-ASCII Free format ASCII number.
- - PACKED-BCD Binary Coded Decimal.
- - FLOATING-POINT IEEE format floating point.
- - MSBIN-FLOAT MS format floating point.
- - LO-HI Compare bytes in reverse.
- - TWOS-COMPLEMENT HI-LO, multi-byte, integer.
- - INTEGER Same as LO-HI + TWOS-COMPLEMENT
- - ZERO-DELIMITED C-type string.
- - PASCAL-STRING Length in first byte.
- - COMPUTATIONAL-3 COBOL Name for PACKED-BCD (abbrev COMP-3)
- - COMPUTATIONAL COBOL Name for TWOS-COMPLEMENT
- - MASK-PARITY-BIT Mask bit seven of every byte.
- - RIGHT-JUSTIFY Right justify a string.
-
- LIST-COMMANDS
-
- List currently active commands.
-
- * OUTPUT-FILE [=] filespec [out-recsize] [file-type] [out-datatype]
-
- Gives the name to be used for the output file. You may specify an
- 'out_recsize' or let the program figure it out. The 'file-type' will
- be the same as the input files, unless specifically changed.
-
- You may also request one of the alternative 'out-datatype' features.
- See "Output File Options" for a detailed explanation of each:
-
- K-OUTPUT, R-OUTPUT, R2-OUTPUT, L-OUTPUT, O-OUTPUT, P-OUTPUT,
- KR-OUTPUT, KR2-OUTPUT, KL-OUTPUT, KO-OUTPUT and KP-OUTPUT.
-
- PAGE-SIZE [=] line-count
-
- Number of lines per page [WRITE-FILE only].
-
- RETURN-TO-CONSOLE
-
- Accept further commands after executing the GO command. Default is
- to finish execution and return to the DOS prompt.
-
- * READ-FILES [=|+] filespec[(from-record, to-record)] [, filespec...]
-
- Specify up to 32 files to be read (not sorted) and processed.
-
- FASTSORT - General Purpose File Sorting and Handling Utility Page 7
-
-
-
- Full Command Reference (continued)
- ----------------------------------
-
- PRINT-LEVEL [=] print-level
-
- Regulate number of messages to be displayed. 0 means no messages.
- 5 means all possible messages. The default is 2.
-
- SELECT|EXCLUDE [=|+] compare [[AND|OR] compare ...]
-
- Select or reject records based on logical criteria. If you code
- multiple SELECT or EXCLUDE records, ALL select statements MUST
- pass the test (evaluate to TRUE) and ALL exclude statements MUST
- fail the test (evaluate to FALSE) for the record to be included.
-
- compare : field [ < | > | <= | <> | >= | = ] data
- or : field [ BT | NB ] data, data
-
- field : FIELD s-col, e-col [key-type]
-
- data : FIELD s-col, e-col | constant-value
-
- Notes: BT means BETWEEN and NB means NOT-BETWEEN.
-
- * SORT-FILES [=|+] filespec[(from-record, to-record)] [, filespec...]
-
- Specify up to 32 files to be read and sorted according to the KEY(s)
- specified. Record numbers start with 1, not 0. No wildcards.
-
- STABLE [ON|OFF]
-
- Maintain records in original order when keys are equal.
-
- TITLE [=|+] 'string'
-
- Up to 3 titles may be specified. [WRITE-FILE only]. See specs for
- FOOTER, for syntax on %p, %m, %d, %y and %mm.
-
- UNIQUE [ON|OFF]
-
- Drop identical keys. Retain only one of each.
-
- WRITE-FILE [=|+] data, data, ..
-
- Build an output record based on specific fields copied from the input
- records. Add PADding at will. For padding, default length is 1 char,
- default pad char is a space. See also TITLE, FOOTER and PAGE-SIZE.
-
- data : FIELD s-col, e-col | PAD [[length] char]
-
- FASTSORT - General Purpose File Sorting and Handling Utility Page 8
-
-
-
-
- Files and Records
- -----------------
-
- While FASTSORT can handle files with over 4.2 billion bytes, and can
- handle the same number of records, an artificial limit has been placed
- on the number of records that can be sorted at one time. The limit was
- placed in order to speed up the Sort/Merge process. The actual limit
- depends on the size of the composite KEY sort and can be computed as
- follows:
-
- Max Records = floor(4096/(key_size+5)) * 120000
-
- The following table might give you a better idea of this limitation:
-
- Key Size Max Records
- 1 byte 81,840,000
- 4 bytes 54,613,342
- 40 bytes 10,922,667
- 128 bytes 3,840,000
- 1040 bytes 480,000
- 2048 bytes 240,000
-
- If you find this limits unacceptable, please write us a letter explaining
- your requirements. A custom version of this program can be easily made,
- to handle more records or larger keys.
-
- FASTSORT can handle files containing many different types of records:
-
- - In a FIXED record length file, all the records have the same number
- of characters. The 'max-record-length' parameter of INPUT-ATTRIBUTES
- is the actual record length.
-
- - A CR-DELIMITED file contains lines of text that are terminated by a
- carriage-return, a line-feed or both. The 'max-record-length' should
- be the maximum number of characters in a record including the line
- delimiters (cr and/or lf). Thus, this document contains lines with
- no more than 80 characters, and the 'max-record-length' is 82.
- Note that lines with no characters (not even spaces) will not be
- copied to the output file by this program.
-
- - VARIABLE length records are files that have a 2 byte binary number
- in front of each record specifying the number of characters in that
- particular record. Again, the 'max-record-length' must be 2 higher
- than the longest line to include the binary number in the record.
- Also, when specifying the keys, the first data column in the record
- is column 3 not 1. If you want to sort by line length, specify a
- 2 column INTEGER field on column 1.
-
- - A special kind of FIXED record length file is a RELATIVE file. This
- file contains fixed length records, but the first six bytes of the
- file contain the 'record-length' and the 'maximum-record-number' in
- the file. A RELATIVE file can hold a maximum of 64K records, and any
- record that consists entirely of binary zeroes is considered to be
- empty and is not copied to the output file.
- FASTSORT - General Purpose File Sorting and Handling Utility Page 9
-
-
-
-
- Files and Records (continued)
- -----------------------------
-
- FASTSORT can handle records up to 64K bytes long. This maximum length
- includes the special delimiters in a CR-DELIMITED file and the two byte
- record length in variable length files
-
- There are many special types of files that contain fixed length records
- but have a header in front of them. If you know the size of this header,
- FASTSORT will correctly handle the file.
-
- All DBASE III .DBF files contain a header with information about the fields
- in the file. The size of the header can be computed as follows:
-
- header-size = (number-of-fields + 1) * 32 + 1.
-
- The length of the records is reported by DBASE III by the command DISPLAY
- STRUCTURE. Each record has 1 additional byte up front. This byte will
- be blank for valid records and a '*' for deleted records. You can use the
- SELECT/EXCLUDE feature to drop deleted record from processing.
-
- The DBASE-III file type will take care of calculating the header for you,
- but example 1 does it the hard way just to show you how to handle headers.
-
- WARNING: The first record on a file is always record 1 not record 0.
-
- WARNING: The first column on a record is always column 1 not column 0.
-
-
- Super-Sort (tm) Compatibility
- -----------------------------
-
- The command interface to FASTSORT is compatible with the command interface
- to Super Sort version 1.6 of MicroPro International. This product has many
- features not found in Super Sort, and does not implement some of the more
- obsolete features in Super Sort. This product is not intended to be 100%
- compatible with Super Sort.
-
- FASTSORT - General Purpose File Sorting and Handling Utility Page 10
-
-
-
- Fields
- ------
-
- You specify the location of a field on a record by providing the starting
- and ending columns on the record.
-
- By default, fields are assumed to contain ASCII information and are sorted
- in ASCII code order (roughly 0,1,2..9,A,B,C,..Z,a,b,c,..z).
-
- You may also specify a field TYPE as any of the following:
-
- - UPPER-CASE
-
- Makes no distinction between upper and lower case letters.
-
- - LEXICAL-ORDER
-
- This is the order that most dictionaries use. Lower case letters will
- follow the equivalent upper case letter.
- In general, the sort order is 0,1,...9,A,a,B,b,C,c...Z,z
-
- - EBCDIC
-
- A field that contains ASCII text will be sorted in EBCDIC order.
- This order is roughly A,B,C,...Z,a,b,c,...z,0,1,...9. Please examine
- the COLLATING SEQUENCE TABLE in the appendix.
-
- - ALTSEQ
-
- The user may specify a special COLLATING-SEQUENCE to be used for this
- field. See syntax for COLLATING-SEQUENCE command for more.
-
- - NUMERIC-ASCII
-
- The field contains an ASCII representation of a number. This field will
- be sorted according to it's NUMERIC value. Up to 14 significant digits
- are used. Note that NUMERIC-ASCII is only for numbers stored as TEXT,
- other field types are available for binary numbers.
-
- - LO-HI
-
- The bytes in this field are stored in reverse order. For example, a
- field containing the value "abcdef" would be stored as "fedcba".
- This is normally the way binary integers are stored in IBM-PC and
- compatible microcomputers.
-
- - PACKED-BCD or COMPUTATIONAL-3
-
- This is a binary representation of a number. Each byte can hold two
- decimal digits. The right-most byte may contain a sign in the lower
- half of it.
-
- FASTSORT - General Purpose File Sorting and Handling Utility Page 11
-
-
-
-
- Fields (continued)
- ------------------
-
- - FLOATING-POINT
-
- This field contains a 4 or 8 byte number in MicroSoft floating point
- format.
-
- - TWOS-COMPLEMENT or COMPUTATIONAL
-
- This is a binary representation of a fixed point number. Please note
- that the field is assumed to be in HI-LO order. On IBM-PC and other
- microcomputers using the Intel 8086 family of microprocessors, binary
- integers are stored in LO-HI (reverse) order. You may specify both
- TWOS-COMPLEMENT and LO-HI or just use the INTEGER type below.
-
- - INTEGER
-
- This field contains a binary number, in 2's complement format with the
- bytes in reverse order (LO-HI). It is the equivalent of specifying
- TWOS-COMPLEMENT and LO-HI for the same field. This field is normally
- 2 or 4 bytes long, but no restrictions are placed by the program.
-
- - ZERO-DELIMITED
-
- This field contains a TEXT string that may not be as long as the field.
- The string is terminated by a binary ZERO. Information found after the
- binary zero is ignored. This is the format normally used for strings
- in the C programming language.
-
- - PASCAL-STRING
-
- This field contains a TEXT string whose length is specified by the first
- byte of the same. No attempt is made to verify that the length fits the
- field. This format is used in the Pascal programming language.
-
- - RIGHT-JUSTIFY
-
- This option applies only to PASCAL-STRINGs and ZERO-DELIMITED strings.
- The string will be padded to the field length with BLANKs before any
- two fields are compared.
-
- - MASK-PARITY-BIT
-
- Bit seven of each byte in this field will be turned off (set to 0).
-
- FASTSORT - General Purpose File Sorting and Handling Utility Page 12
-
-
-
-
- Output File Options
- -------------------
-
-
- Normally, the output file contains the rearranged input records. This is
- referred to as FULL RECORD OUTPUT. In addition, there are 4 special types
- of output = keys, record numbers, segment pointers, and byte offsets that
- can be combined to create 11 types of files useful for many different
- purposes.
-
-
- - K-OUTPUT
-
- The output file will contain the sorted keys only. Add an output type
- of CR-DELIMITED to be able to print and/or edit the output file. You
- may find this file useful as an index file that can be binary searched.
-
- Please note that the KEYS in this file have been transformed according
- to the key-type specifications and may not be in a usable format. For
- example, a DESCENDING specification will have XOR (exclusive or) the
- key with hex 'FF', an UPPER-CASE key will have all the characters in
- upper case and a NUMERIC-ASCII key will be stored in a 9 byte packed
- BCD floating point format. For more information on the transformation
- process please see appendix E "Key Transformations".
-
-
- - L-OUTPUT
-
- The output file will contain only the record numbers, (remember that the
- first record is 1 not 0), arranged according to the keys you specified.
- This type of file is useful as a fast, compact index into a big data
- file. Your program may use this file to access the data file in many
- different sorted orders without having to have many copies of the file
- on the disk.
-
- FIXED, VARIABLE and RELATIVE files will contain 4 byte records each
- holding a single record number in TWOS-COMPLEMENT, LO-HI format. For
- multi-file input, a single byte file number is prefixed to the record
- making it a 5 byte record.
-
- For CR-DELIMITED files, the record numbers will be stored as ASCII text
- using 12 characters (+2 for the carriage return and the line feed).
- This file can be accessed as fixed length (14 bytes) if you want to.
- The record numbers are padded with "0" (Ex: "0000034653"). For multi-
- file input, a 3 digit file number is prefixed (Ex: "002,0000034653")
- and a comma (,) separates the two numbers.
-
- FASTSORT - General Purpose File Sorting and Handling Utility Page 13
-
-
-
-
- Output File Options (continued)
- -------------------------------
-
-
- - O-OUTPUT
-
- The output file will contain byte offsets into the file (the first byte
- in the file being byte 0). This is very useful to create an index into
- a VARIABLE or CR-DELIMITED file. Your program can perform seeks to the
- exact position where the record you want starts.
-
- FIXED, VARIABLE and RELATIVE files will contain 4 byte records each
- holding an offset in TWOS-COMPLEMENT, LO-HI format. For multi-file
- input, a single byte file number is prefixed to the record making it
- a 5 byte record.
-
- For CR-DELIMITED files, the offsets will be stored as ASCII text using
- using 12 characters (+2 for the carriage return and the line feed).
- This file can be accessed as fixed length (14 bytes) if you want to.
-
-
- - R-OUTPUT (Super Sort Compatible)
-
- This is a 2 byte version of L-OUTPUT with the added quirk of a single
- byte binary zero in front of it. This is a Super Sort compatible file
- and is not expected to be useful to non-Super Sort fans.
-
- Binary records will be 3 bytes long (4 for multi-file input).
- Example: [0001A7] or [00030180]
-
- CR-DELIMITED records have 6 character record numbers. If you don't
- plan to have more than 999999 records, this format might be preferable
- to L-OUTPUT (only for CR-DELIMITED output).
-
-
- - R2-OUTPUT (Super Sort Compatible)
-
- This is the same as above, but uses a 4 byte integer thus allowing more
- than 4 billion records (2^32 - 1 to be exact). Records contain the
- Super Sort specified binary zero.
-
- The CR-DELIMITED version of R2-OUTPUT is exactly equivalent to the
- CR-DELIMITED version of L-OUTPUT.
-
- FASTSORT - General Purpose File Sorting and Handling Utility Page 14
-
-
-
-
- Output File Options (continued)
- -------------------------------
-
-
- - P-OUTPUT (Super Sort Compatible)
-
- The input file(s) are divided into blocks of 128 bytes each. A pair of
- numbers (block,offset) are calculated for each record. The first block
- is block number 1 and the first byte in each block is byte 1.
-
- For FIXED, VARIABLE and RELATIVE output, the numbers will be stored in
- TWOS-COMPLEMENT, LO-HI format, each using 2 bytes. A file number will
- be prefixed for multi-file input.
-
- For CR-DELIMITED output, each number is stored in 6 character, zero-
- filled format, with a 3 character file number for multi-file input.
- Example "003423,000028" or "004,004320,000121".
-
-
- - KL-, KO-, KR-, KR2- and KP-OUTPUT.
-
- To make the previous formats even more useful, an extension of the
- K-OUTPUT option allows you to get the record number, byte offset or
- whatever is right after the KEY in a combined Kx-OUTPUT option. This
- is perhaps the most useful output option because it allows you to create
- sorted KEY files that can be binary searched to locate a particular key
- and then allows you to access the original data file to retrieve the full
- record. A powerful relational data base can be easily written using the
- Kx-OUTPUT options as the heart of it's indexing capabilities.
-
- Please see the appendix "Examples and Tips" for additional information.
-
- FASTSORT - General Purpose File Sorting and Handling Utility Page 15
-
-
-
-
- Key Transformations
- -------------------
-
- When FASTSORT reads the input records, it creates a single KEY that can
- be easily sorted. This key contains the information found on each of the
- individual fields specified in one or more KEY commands. Each field is
- individually transformed according to the following rules. When using
- the K-OUTPUT or Kx-OUTPUT options, certain key attributes will totally
- alter the key information and special approaches may be needed if you
- have to have an unmodified key in your output file. Please see example
- number 3 for an easy way to accomplish this task.
-
- - DESCENDING
-
- The field is one's complemented after all necessary transformations
- have taken place.
-
- - UPPER-CASE
-
- All lower case characters in the field are translated to upper case.
-
- - LEXICAL-ORDER, EBCDIC and ALTSEQ
-
- Every character on this field is transformed into a sequence code
- from 0 through 255. This will most likely make the field totally
- unreadable. In the case of EBCDIC, the resultant field will be the
- actual EBCDIC character equivalent to the original ASCII character.
-
- - NUMERIC-ASCII
-
- The number will be translated to an internal 9 byte sortable floating
- point representation. The number is in excess 513, with 14 decimal
- digits of precision.
-
- + Bit 7 of Byte 0 is ON (1).
- + Bits 6 through 0 and byte 1 contain the excess 513 exponent.
- + Bytes 2-6 contain the significant digits, 4 bits each. (Zero Padded)
- + The whole field is one's complemented if the number is negative.
-
- - LO-HI
-
- The bytes in this field are stored in reverse order.
-
- - PACKED-BCD or COMPUTATIONAL-3
-
- A hex 'FF' byte is prefixed to the field. If signed, the field is
- shifted right 4 bits to delete the sign. If the sign was negative
- the whole field is one's complemented (including the added byte).
-
- FASTSORT - General Purpose File Sorting and Handling Utility Page 16
-
-
-
-
- Key Transformations (continued)
- -------------------------------
-
- - FLOATING-POINT
-
- The bytes in the field are reversed. If byte 0 is 0, all bytes are
- set to 0 otherwise:
-
- + set bit 7 of byte 1 to bit 0 of byte 0.
- + shift byte 0 right one bit position.
- + set bit 7 of byte 0 to 1.
- + if bit 7 of byte 0 was 1 before the first step (negative number),
- one's complement all bytes.
-
- - TWOS-COMPLEMENT or COMPUTATIONAL
-
- Complement bit 7 of byte 0.
-
- - INTEGER
-
- Reverse the order of the bytes. Complement bit 7 of byte 0.
-
- - ZERO-DELIMITED
-
- Trailing Spaces are added to the field.
-
- - PASCAL-STRING
-
- Drop the length field. Add trailing spaces to the field.
-
- - RIGHT-JUSTIFY
-
- For PASCAL-STRING and ZERO-DELIMITED fields, leading spaces will be
- added instead of trailing ones.
-
- - MASK-PARITY-BIT
-
- Bit seven of each byte in this field will be turned off (set to 0).
-
-
- FASTSORT - General Purpose File Sorting and Handling Utility Page 17
-
-
- Examples and Tips
- -----------------
-
- The following examples are meant to show the wide variety of needs that
- can be met by FASTSORT. Your feed back on this and any other section
- of this manual will be appreciated.
-
- Example 1.
-
- You need to create a company Phone List to post on the office's bulletin
- board. The information can be found in the DBASE III employee management
- system, but you need to edit the information with your word processor.
-
- You find that the employee file has 800 characters per record, the phone
- number is stored in columns 345 through 355 and the employee's name is
- in columns 546 through 582. There are 420 fields in the employee file.
-
- INPUT = 800, DBASE
- SORT = EMPLOYEE.DBF
- OUTPUT = PHONE.LST K-OUTPUT CR-DEL /* CR to print the list
- EXCLUDE = FIELD 1, 1 EQ '*' /* Drop empty records
- KEY = 546, 582 ASC /* The name first
- KEY + 345, 355 ASC /* The phone number last
- GO /* Sort it
-
- Example 2.
-
- You need a quick list of all your clients, but the only place to get
- it from is from the SHIPPING records. The shipping file contains over
- 40 thousand records, as most clients place orders several times a day.
-
- INPUT 520 FIXED
- SORT SHIPPING.LOG
- OUTPUT CLIENTS.LST K-OUTPUT CR-DELIMITED
- UNIQUE /* No repeat keys.
- KEY 32, 51 UPPER-CASE ASC /* Translate names to UPCASE
- GO
-
- Example 3.
-
- You want the above list of clients, but you MUST have it in descending
- order. Remember that the DESCENDING attribute transforms the key data.
-
- INPUT 520 FIXED
- SORT SHIPPING.LOG
- OUTPUT CLIENTS.LST K-OUTPUT
- UNIQUE /* No repeat keys.
- KEY 32, 51 UPPER-CASE ASC
- RETURN-TO-CONSOLE /* Sort, but I'm not finished yet.
- GO
- CANCEL /* Erase all of the above.
- INPUT 20 FIXED /* A 20 character record
- SORT CLIENTS.LST /* Read output from previous sort
- OUTPUT CLIENTS.LST 22 CR-DELIMITED /* Create a CR-DEL file
- KEY 1 20 DESC
- GO ; BYE /* Sort and Good Bye */
-
- FASTSORT - General Purpose File Sorting and Handling Utility Page 18
-
-
- Examples and Tips (continued)
- -----------------------------
-
- Example 4.
-
- You need to sort and print a file in 3 different orders.
-
- INPUT 80 CR-DEL
- SORT NAMES.LST
- OUTPUT PRN /* Write to the printer.. full records
- RETURN-TO-CONSOLE
- KEY = 1, 20 /* Sorted by NAME
- GO
- KEY = 25, 38 /* Sorted by PHONE
- GO
- KEY = 40, 40, 1, 20 /* By SEX then by NAME
- GO
- BYE /* Needed due to RETURN-TO-CONSOLE
-
-
- Example 5.
-
- You need to print a directory of employees, but nicer than example #1.
-
- INPUT = 171, DBASE
- SORT = EMPLOYEE.DBF
- OUTPUT = PHONE.LST CR-DEL 80
- EXCLUDE = FIELD 1, 1 EQ '*'
- KEY = 6, 35 ASC
- TITLE = 'Name Address Phone//%mm %d, 19%y'
- TITLE + '-------------------- -------------------- --------------'
- WRITE = F 6, 25
- WRITE + PAD, FIELD 36, 55, PAD
- WRITE + PAD '(', FIELD 96, 98, PAD ')'
- WRITE + PAD, FIELD 99, 101
- WRITE + PAD '-', FIELD 102, 105
- FOOTER = '/- %p -/'
- GO
-
- FASTSORT - General Purpose File Sorting and Handling Utility Page 19
-
-
-
- What the future holds
- ---------------------
-
- We are currently working on some enhancements that will truly make this
- product an indispensable tool. Suggestions are welcomed. Any suggestion
- that is adopted and implemented will be acknowledged on the documentation
- for the newer releases. A free update will also be sent to the first
- person to suggest that particular enhancement.
-
- Expanded Reporting Capabilities
- -------------------------------
-
- In report writing, the ability to specify break levels in the sort key
- and to keep totals:
-
- BREAK [=|+] key number, key number..
-
- TOTAL [=|+] FIELD s-col, e-col [numeric-field-type]
-
- Finally, adding a 'input-data-type' field to the WRITE-FILE command will
- allow you to create reports from binary files. (the field would be trans-
- formed into an ASCII field).
-
-
- Extended and/or Expanded Memory Support
- ---------------------------------------
-
- We will be looking to support extended and/or expanded memory for super-
- fast sorting of BIG files. It really depends on what our users tell us
- about their sorting needs.
-
-
- FASTSORT - General Purpose File Sorting and Handling Utility Page 20
-
-
-
- The EZSORT interface
- --------------------
-
- Recognizing that sometimes you need to do a one-time SORT, or that you may
- not have the time to memorize the command syntax for FASTSORT, we have made
- the EZSORT interface for easy, fast, no-frills sorting.
-
- This program will display a screen where you may type the input and output
- file names, types, lengths, as well as the keys, titles and other options.
-
- Note that if you enter a TITLE or a FOOTER, the KEY fields will be copied
- into WRITE-FILE commands, separated by spaces. This feature allows you to
- create simple reports from the EZSORT interface without having to enter
- the same information twice. You can always edit the resulting command
- file to modify the actual report generated.
-
- Extensive context sensitive help will help new users get up and running in
- a jiffy. The interface can generate command files (xx.CF) or can call the
- FSORT.EXE program directly. The CF files generated can be edited by the
- user to do minor adjustments, without having to remember the exact syntax
- of the standard commands.
-
- To use the interface, run EZSORT from the dos prompt:
-
- C> EZSORT<enter>
-
- Fill in the blanks and press:
-
- F1 - For help on the specific field the cursor is on.
-
- F2 - To create a command file (EZSORT.CF) and execute the FSORT program
- immediately. After the sort is finished, control will return to
- DOS, not EZSORT.
-
- F6 - To create a command file with a specific name. The EZSORT
- interface will ask you for the name after you press F6.
-
- F10- To exit the EZSORT program.
-
- Note that the information you have typed will not be retained.
-
- If you would like to see the EZSORT interface extended, please write us a
- letter telling us about it.
-
-
- FastSort - Version 1.60 - General Purpose File Sorting and Handling Utility
-
-
-
- Mail registration form to: DC Software, 6705 Laramie Dr., Plano TX 75023
- -------------------------
-
- Your Mailing Address
- --------------------
-
- Name : ______________________________________________
-
- Title : ______________________________________________ (optional)
-
- Street: ______________________________________________
-
- City : _______________________ State __ Zip _____
-
-
- Type of Registration
- --------------------
-
- [ ] Mailing List Only. $10 fee.
-
- [ ] Full Registration. $25 fee.
-
- [ ] Multiple Copies. $25 fee (1st copy). $10 per additional copy.
-
- [ ] Unlimited Copies (Per Site). $100 fee.
-
- [ ] Change of Address only. No fee.
-
-
- System Configuration (optional)
- -------------------------------
-
- CPU Type: ________ Speed: ________ Hard Disk _____________________
-
- DOS Version: ___.___ Graphics: ____________ Printer: ___________
-
- Where did you get the program from? ______________________________
-
-
- Your Comments
- -------------
-
- __________________________________________________________________
- __________________________________________________________________
- __________________________________________________________________
- __________________________________________________________________
- __________________________________________________________________
- __________________________________________________________________
- __________________________________________________________________
- __________________________________________________________________
-
-
- ----------------end-of-author's-documentation---------------
-
- Software Library Information:
-
- This disk copy provided as a service of
-
- Public (software) Library
-
- We are not the authors of this program, nor are we associated
- with the author in any way other than as a distributor of the
- program in accordance with the author's terms of distribution.
-
- Please direct shareware payments and specific questions about
- this program to the author of the program, whose name appears
- elsewhere in this documentation. If you have trouble getting
- in touch with the author, we will do whatever we can to help
- you with your questions. All programs have been tested and do
- run. To report problems, please use the form that is in the
- file PROBLEM.DOC on many of our disks or in other written for-
- mat with screen printouts, if possible. PsL cannot debug pro-
- programs over the telephone, though we can answer questions.
-
- Disks in the PsL are updated monthly, so if you did not get
- this disk directly from the PsL, you should be aware that the
- files in this set may no longer be the current versions. Also,
- if you got this disk from another vendor and are having prob-
- lems, be aware that some files may have become corrupted or
- lost by that vendor. Get a current, working disk from PsL.
-
- For a copy of the latest monthly software library newsletter
- and a list of the 3,000+ disks in the library, call or write
-
- Public (software) Library
- P.O.Box 35705 - F
- Houston, TX 77235-5705
-
- 1-800-2424-PSL
- MC/Visa/AmEx/Discover
-
- Outside of U.S. or in Texas
- or for general information,
- Call 1-713-524-6394
-
- PsL also has an outstanding
- catalog for the Macintosh.
-